phpDocumentor Web Commons
[ class tree: Web Commons ] [ index: Web Commons ] [ all elements ]

Class: SlotHolder

Source Location: /view.php

Class SlotHolder

Class Overview

Holds several slots.

A slot is a cross-template variable, like a block, a title or even an object.

Located in /view.php [line 16]



		
				Author(s):
		
Information Tags:
Since:  0.1

Methods

[ Top ]
Method Summary
void   add()   Adds a slot.
void   close()   Stores the previously opened slot. Throws a SlotException if no slot is open.
void   crashIfExists()   Throws a SlotException if slot $name exists.
void   crashIfOpen()   If a slot is open, terminates the output buffer and throws a SlotException.
bool   exist()   Returns True if slot $name exists, False otherwise.
mixed   getOrCrash()   Returns the slot $name.
mixed   getOrDefault()   Returns the value of slot $name if it exists, the default value otherwise.
bool   isOpen()   Returns True if a slot is opened.
void   open()   Opens a slot. Its contents will be the text printed until a call to SlotHolder::close() is issued.

[ Top ]
Methods
add  [line 40]

  void add( string $name, mixed $value  )

Adds a slot.

Slot $name must not exist.

Parameters:
string   $name:  name for this slot
mixed   $value:  value for this slot

API Tags:
Access:  public

Information Tags:
Since:  0.1

[ Top ]
close  [line 106]

  void close( )

Stores the previously opened slot. Throws a SlotException if no slot is open.


API Tags:
Access:  public

Information Tags:
Throws:  SlotException
Since:  0.1

[ Top ]
crashIfExists  [line 62]

  void crashIfExists( $name  )

Throws a SlotException if slot $name exists.

Parameters:
   $name: 

API Tags:
Access:  public

Information Tags:
Throws:  SlotException
Since:  0.1

[ Top ]
crashIfOpen  [line 76]

  void crashIfOpen( )

If a slot is open, terminates the output buffer and throws a SlotException.


API Tags:
Access:  public

Information Tags:
Throws:  SlotException
Since:  0.1

[ Top ]
exist  [line 163]

  bool exist( string $name  )

Returns True if slot $name exists, False otherwise.

Parameters:
string   $name: 

API Tags:
Access:  public

Information Tags:
Since:  0.1

[ Top ]
getOrCrash  [line 146]

  mixed getOrCrash( string $name  )

Returns the slot $name.

Throws a SlotException if this slot does not exist.

Parameters:
string   $name: 

API Tags:
Access:  public

Information Tags:
Throws:  SlotException
Since:  0.1

[ Top ]
getOrDefault  [line 133]

  mixed getOrDefault( string $name, mixed $default  )

Returns the value of slot $name if it exists, the default value otherwise.

Parameters:
string   $name: 
mixed   $default: 

API Tags:
Access:  public

Information Tags:
Since:  0.1

[ Top ]
isOpen  [line 52]

  bool isOpen( )

Returns True if a slot is opened.


API Tags:
Access:  public

Information Tags:
Since:  0.1

[ Top ]
open  [line 92]

  void open( string $name  )

Opens a slot. Its contents will be the text printed until a call to SlotHolder::close() is issued.

No slot must be opened, and slot $name must not exist.

Parameters:
string   $name:  the name of this slot

API Tags:
Access:  public

Information Tags:
Since:  0.1

[ Top ]

Documentation generated on Fri, 16 Jul 2010 00:48:40 +0200 by phpDocumentor 1.4.3